package com.ruoyi.health.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.health.mapper.HealthClockMapper;
import com.ruoyi.health.domain.HealthClock;
import com.ruoyi.health.service.IHealthClockService;

/**
 * 打卡信息Service业务层处理
 * 
 * @author rockvan
 * @date 2023-04-10
 */
@Service
public class HealthClockServiceImpl implements IHealthClockService 
{
    @Autowired
    private HealthClockMapper healthClockMapper;

    /**
     * 查询打卡信息
     * 
     * @param id 打卡信息主键
     * @return 打卡信息
     */
    @Override
    public HealthClock selectHealthClockById(Long id)
    {
        return healthClockMapper.selectHealthClockById(id);
    }

    /**
     * 查询打卡信息列表
     * 
     * @param healthClock 打卡信息
     * @return 打卡信息
     */
    @Override
    public List<HealthClock> selectHealthClockList(HealthClock healthClock)
    {
        return healthClockMapper.selectHealthClockList(healthClock);
    }

    /**
     * 新增打卡信息
     * 
     * @param healthClock 打卡信息
     * @return 结果
     */
    @Override
    public int insertHealthClock(HealthClock healthClock)
    {
        healthClock.setCreateTime(DateUtils.getNowDate());
        return healthClockMapper.insertHealthClock(healthClock);
    }

    /**
     * 修改打卡信息
     * 
     * @param healthClock 打卡信息
     * @return 结果
     */
    @Override
    public int updateHealthClock(HealthClock healthClock)
    {
        healthClock.setUpdateTime(DateUtils.getNowDate());
        return healthClockMapper.updateHealthClock(healthClock);
    }

    /**
     * 批量删除打卡信息
     * 
     * @param ids 需要删除的打卡信息主键
     * @return 结果
     */
    @Override
    public int deleteHealthClockByIds(Long[] ids)
    {
        return healthClockMapper.deleteHealthClockByIds(ids);
    }

    /**
     * 删除打卡信息信息
     * 
     * @param id 打卡信息主键
     * @return 结果
     */
    @Override
    public int deleteHealthClockById(Long id)
    {
        return healthClockMapper.deleteHealthClockById(id);
    }
}
